package com.chb.javabasic.jpa;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface User2Repository  extends JpaRepository<User2, Long> {
    // 自定义查询方法，根据用户名查询用户
    Optional<User2> findByUsername(String username);

    void deleteByUsername(String username);
}
